package feizhou.untils.tools;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/**
 * @Description: 
 * @author zihu.xu
 * @date 2018年7月12日
 * @version 6.2.0
 * @Copyright: Copyright (c) 2018
 */
public class RabbitMqUtil {
	public static String EXCHANGEDATECONFLICT;
	public static String KEYDATECONFLICT;
	public static String KEYTRACKVIDEO;
	public static String KEYORDERLOGISTICS;
	public static String KEYCOUPONCASHGIFTADVISE;
	public static String KEYTRACK3DVIDEOINFO;
    
    private static Map<String,String>datas=new HashMap<>();
    static {
        InputStream is = RabbitMqUtil.class.getClassLoader().getResourceAsStream("rabbitmq.properties");
        Properties property = new Properties();
        try {
            property.load(is);
            
            EXCHANGEDATECONFLICT = property.getProperty("tbl.tcp.exchange.helper.communication");
            KEYDATECONFLICT = property.getProperty("tbl.tcp.route.date.conflict");
            KEYTRACKVIDEO = property.getProperty("tbl.tcp.route.track.video");
            KEYORDERLOGISTICS = property.getProperty("tbl.tcp.route.order.logistics");
            KEYCOUPONCASHGIFTADVISE = property.getProperty("tbl.tcp.route.coupon.cash.gift");
            KEYTRACK3DVIDEOINFO = property.getProperty("tbl.tcp.route.track.3d.video.info");
            Set<String> strings = property.stringPropertyNames();
            for (String s:strings){
                datas.put(s,property.getProperty(s));
            }
        }
        catch (IOException e) {
            // TODO Auto-generated catch block
            System.out.print("获取properties异常");
            e.printStackTrace();
            
        }
    }


    public static String getProperty(String key){
        return datas.get(key);
    }

    public static void main(String[] args) {
        System.out.println("str: "+RabbitMqUtil.getProperty("tbl.tcp.route.track.video"));
    }
}
